﻿using UnityEngine;
using System.Collections;

namespace CameraControl
{
	/// <summary>
	/// Cam target controller.
	/// </summary>
	public class CamTargetController : MonoBehaviour
	{
		public float speed = 5.0f;
		private float intitialSpeed = 0;

		// Use this for initialization
		void Start ()
		{
			intitialSpeed = speed;
		}

		// Update is called once per frame
		void Update ()
		{
			if (Input.GetKey (KeyCode.LeftShift)) {
				speed = 100.0f;
			} else {
				speed = intitialSpeed;
			}
			float moveX = Input.GetAxisRaw ("Horizontal") * speed * Time.deltaTime;
			float moveZ = Input.GetAxisRaw ("Vertical") * speed * Time.deltaTime;

			// Move and rotate the player
			transform.Translate (moveX, 0.0f, moveZ);
		}
	}
}
